<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('人工补录任务列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" name="inputType" id="inputType" value="">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <p>交易日期</p>
                            <input type="text" class="time-input" placeholder="交易日期" name="trDate"/>
                        </li>
                        <li>
                            <p>机构号</p>
                            <input name="orgCode" id="treeId" type="text" placeholder="请选择" class="form-control" required><!--onclick="selectDeptTree()" -->
                        </li>
                        <li>
                            <p>柜员号</p>
                            <input type="text" name="tellerCode"/>
                        </li>

                        <!--<li>
                            <p>扫描员</p>
                            <input type="text" name="createor"/>
                        </li>
                        <li>
                            <p>补录员</p>
                            <input type="text" name="inputer"/>
                        </li>
                        <li>
                            <p>当前操作员</p>
                            <input type="text" name="capturer"/>
                        </li>
                        <li>
                            <p>强制补录员</p>
                            <input type="text" name="forceInputer"/>
                        </li>
                        <li>
                            <p>状态</p>
                            <select name="status" th:with="type=${@dict.getType('sdi_paea_arc_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <p>特殊状态</p>
                            <select name="statusCode" th:with="type=${@dict.getType('sdi_paea_arc_status_code')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="selectRow()"><i class="fa fa-refresh"></i>&nbsp;选择</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('sdi:sdiPaeaArc:edit')}]];
    var removeFlag = [[${@permission.hasPermi('sdi:sdiPaeaArc:remove')}]];
    var reStatusDatas = [[${@dict.getType('sdi_paea_arc_re_status')}]];
    var typeDatas = [[${@dict.getType('sdi_paea_arc_type')}]];
    var statusDatas = [[${@dict.getType('sdi_paea_arc_status')}]];
    var statusCodeDatas = [[${@dict.getType('sdi_paea_arc_status_code')}]];
    var parentIdDatas = [[${@dict.getType('sdi_paea_arc_parent_id')}]];
    var prefix = '/sdi/input';
    var inputType = [[${inputType}]];
    $("#inputType").val(inputType);
    $(function() {
        var options = {
            url: prefix + "/listPausedTask",
            modalName: "扫描批次",
            //启用跳转至指定页
            showPageGo: true,
            //启用点击选中行
            clickToSelect: true,
            onDblClickRow: function() {
                selectRow();
            },
            columns: [{
                radio: true
            },
                {
                    field : 'id',
                    title : '主键',
                    visible: false
                },
                {
                    field : 'trDate',
                    title : '交易日期'
                },
                {
                    field : 'orgCode',
                    title : '机构号'
                },
                {
                    field : 'tellerCode',
                    title : '柜员号'
                },
                {
                    field : 'frontNum',
                    title : '正面总数'
                },
                {
                    field : 'createor',
                    title : '扫描员'
                },
                {
                    field : 'status',
                    title : '状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    }
                }]
        };
        $.table.init(options);
    });


    //选择机构
    function selectDeptTree() {
        var treeId = $("#treeId").val();
        var deptId = $.common.isEmpty(treeId) ? "00038" : $("#treeId").val();
        var url = ctx + "system/dept/selectDeptTree/" + deptId;
        var options = {
            title: '选择部门',
            width: "380",
            url: url,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        if ($.tree.notAllowParents(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#treeId").val(body.find('#treeId').val());
            layer.close(layer.index);
        }
    }

    function selectRow()
    {
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        window.returnValue= row.id;
        window.close();
    }
</script>
</html>